Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(contexts): Simplify user context #80704

Merged
merged 3 commits into from
Nov 14, 2024
Merged

chore(contexts): Simplify user context #80704

merged 3 commits into from
Nov 14, 2024

Conversation

leeandher
Copy link
Member

See #80420

12/13

@leeandher leeandher requested a review from a team as a code owner November 13, 2024 22:07
@leeandher leeandher changed the title chore(contexts): Simplify user contex chore(contexts): Simplify user context Nov 13, 2024
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 13, 2024
Comment on lines +23 to +31
[UserContextKeys.GEO]?: Partial<Record<UserContextGeoKeys, string>>;
}

enum UserContextGeoKeys {
CITY = 'city',
COUNTRY_CODE = 'country_code',
SUBDIVISION = 'subdivision',
REGION = 'region',
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to add these to the serializer since these are used all over but not rendered on issue details for some reason.

Requires #80704 to render on
issue details.

These files are 6-8 years old, so I'm not really sure why this data
wasn't exposed to the frontend via`get_api_context` (called
by`EventSerializer` on 'group_event_details.py`) and this isn't
releasing any new data. This data is actually already accessible via the
event JSON.

For example:
- This issue says nothing about geo data in the UI
([link](https://demo.sentry.io/issues/6051030798/events/6d1970669234406c9806913e117982da/?project=5808623))
- But the JSON (via View JSON button) for the issue does
([link](https://us.sentry.io/api/0/projects/demo/react/events/6d1970669234406c9806913e117982da/json/))
<img width="418" alt="image"
src="https://github.com/user-attachments/assets/c7f16a2c-4cc3-42a2-b6d9-97ff768be368">
@leeandher leeandher requested a review from a team as a code owner November 14, 2024 15:51
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 14, 2024
Copy link
Contributor

🚨 Warning: This pull request contains Frontend and Backend changes!

It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently.

Have questions? Please ask in the #discuss-dev-infra channel.

Copy link

codecov bot commented Nov 14, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 5 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...p/components/events/contexts/knownContext/user.tsx 77.27% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #80704      +/-   ##
==========================================
+ Coverage   74.24%   78.39%   +4.14%     
==========================================
  Files        7204     7207       +3     
  Lines      319200   319371     +171     
  Branches    43967    43986      +19     
==========================================
+ Hits       236994   250374   +13380     
+ Misses      75716    62614   -13102     
+ Partials     6490     6383     -107     

@leeandher leeandher merged commit e38b7b4 into master Nov 14, 2024
53 of 54 checks passed
@leeandher leeandher deleted the leander/rm-user-ctx branch November 14, 2024 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants